package com.blockmeta.bbs.overallserviceapplication.net.api;

import com.blockmeta.bbs.businesslibrary.net.pojo.BaseCodeResponse;
import com.blockmeta.bbs.businesslibrary.pojo.LoginPOJO;

import java.util.Map;

import io.reactivex.Flowable;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.POST;

/**
 * @author AirThor
 * @date 2020/2/3.
 */
public class NetApi {
    public static MediaType sMediaType = MediaType.parse("application/json; charset=utf-8");

    public interface AccountLogin{
        /**
         * 账号密码登录
         * @see "https://www.tapd.cn/31959976/markdown_wikis/view/#1131959976001001289"
         * @return .
         */
        @POST("accountopen/login")
        Flowable<BaseCodeResponse<LoginPOJO>> accountLogin(@Body RequestBody requestBody);

        @POST("accountopen/register")
        Flowable<BaseCodeResponse<Boolean>> accountRegister(@Body RequestBody requestBody);
    }
    public interface PhoneLogin{
        /**
         * 账号密码登录
         * @see "https://www.tapd.cn/31959976/markdown_wikis/view/#1131959976001001289"
         * @return .
         */
        @POST("accountopen/login")
        Flowable<BaseCodeResponse<LoginPOJO>> accountLogin(@Body RequestBody requestBody);
    }

    public interface SocialLogin{
        /**
         * 三方账号登录
         * @see "https://www.tapd.cn/31959976/markdown_wikis/view/?left_tree=1#1131959976001001290"
         * @param requestBody 请求体
         * @return 。
         */
        @POST("accountopen/login")
        Flowable<BaseCodeResponse<LoginPOJO>> socialLogin(@Body RequestBody requestBody);
    }

    public interface SocialBind{
        /**
         * 三方账号绑定
         * @see "https://www.tapd.cn/31959976/markdown_wikis/view/?left_tree=1#1131959976001001290"
         * @param requestBody 请求体
         * @return
         */
        @POST("accountopen/bind")
        Flowable<BaseCodeResponse<LoginPOJO>> bindSocial(@Body RequestBody requestBody);
    }

    public interface ModifyPwd{
        @POST("account/unifyAppUpdatePwd")
        Flowable<BaseCodeResponse<Map<String,Object>>> modifyPwd(@Body RequestBody requestBody);
    }
}
